Repository navigation
Fix failover and reservation capacity underreporting - #1247
Merged
Merged
Conversation
Signed-off-by: juliusclausnitzer <julius.clausnitzer@sap.com>
Signed-off-by: juliusclausnitzer <julius.clausnitzer@sap.com>
mblos
marked this pull request as ready for review
September 28, 2026 14:02
mblos
requested review from
PhilippMatthes,
SoWieMarkus,
auhlig,
mblos and
umswmayj
as code owners
September 28, 2026 14:02
mblos
reviewed
Sep 28, 2026
mblos
previously approved these changes
Sep 28, 2026
Contributor
|
Review — no issues found ✅ Checked for codebase-specific pitfalls (RBAC gaps, CRD migration risks, multicluster wiring, controller registration, double-counting):
Clean PR. 👍 🤖 Generated with Claude Code |
Co-authored-by: Marcel <156897072+mblos@users.noreply.github.com> Signed-off-by: juliusclausnitzer <julius.clausnitzer@sap.com>
Contributor
Test Coverage ReportTest Coverage 📊: 73.1% |
auhlig
approved these changes
Sep 28, 2026
SoWieMarkus
approved these changes
Sep 28, 2026
umswmayj
added a commit
that referenced
this pull request
Sep 29, 2026
* Fix failover and reservation capacity underreporting (#1247) * Use cobaltcore-dev secrets for claude workflows (#1241) * Add reusable Cortex Agents GitHub integration (#1236) * Bump cortex-shim to 0.1.21 and cortex-placement-shim to 0.1.21 * Add CHANGELOG entry for cortex v0.4.6 / bundles v0.0.95 Signed-off-by: Malte <140147670+umswmayj@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix capacity underreporting: attribute reserved capacity per-reservation
Reserved-but-empty capacity (failover reservations and unfilled committed-resource slots) was subtracted from the placeable probe and the round-robin split but never added back to the report, so it counted as neither used nor free and dropped out of reported capacity — most visibly for HANA and every group's
_cores/_instances. Regression from #983.Approach
A host's hardware splits into three disjoint slices, each attributed by its own key — no host→group mapping needed:
ResourceGroup(new)Reserved is now read per-reservation from its spec: committed reservations carry the group directly; failover reservations carry the group name, or the flavor name (resolved to its group) when
useFlavorGroupResourcesis disabled. Since the split already nets out reservations before partitioning free capacity, the three slices sum back to installed hardware with no double-count — and a host fully packed by empty reservations still contributes.Changes
capacity/controller.go—reservedResourcesByGroupAZsums each placed reservation'sUnusedReservationCapacityper(group, AZ); threaded into the CRD write.flavor_group_capacity_types.go(+ generated CRD/deepcopy) — new status fieldsExclusivelyReservedCapacity,ExclusivelyReservedSlots.commitments/capacity.go— reserved added to instances/cores/fixed-ratio-RAM in both capacity and usage, socapacity − usagestays equal to the truly-free amount. GP raw_rampath unchanged.Notes
CommittedResourceandFailovertypes count;InFlightis counted as running.Testing
makegreen. New tests cover per-reservation attribution (fully-packed host, shared host across two groups, failover-by-flavor-name, pending/in-flight skipped), CRD plumbing, and the fixed-ratio report math.